.control-panel-container {
  position: fixed;
  bottom: 0px;
  right: 0px;
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 10px;
}

.control-panel-menu-bar {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: rgba(31, 41, 55, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: white;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.3s ease;
  outline: none;
  position: relative;
  overflow: hidden;
}

.menu-item:focus {
  outline: none;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.5), rgba(147, 51, 234, 0.5));
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

.menu-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #9333ea);
}

.menu-item span {
  font-size: 14px;
}

.panel-container {
  width: 400px;
  height: 600px;
  background: rgba(31, 41, 55, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 300ms ease-in-out;
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0px;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
}

.panel-container.visible {
  opacity: 1;
  visibility: visible;
}

.panel-container.collapsed {
  height: 80px;
  overflow: hidden;
}

.panel-content {
  padding: 16px;
  padding-top: 0px;
  color: white;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-content h3 {
  font-size: 20px;
}

.panel-body {
  height: calc(100% - 32px);
  overflow-y: auto;
}

.close-button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 28px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}

.close-button:hover {
  color: white;
  transform: scale(1.1);
}

/* Cinematic Panel Styles */
.cinematic-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.cinematic-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.cinematic-filters {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: transparent;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
  background: rgba(59, 130, 246, 0.5);
  border-color: rgba(59, 130, 246, 0.8);
}

.cinematic-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  margin-right: -8px;
}

.cinematic-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.cinematic-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.card-content {
  flex: 1;
}

.card-header {
  margin-bottom: 8px;
}

.card-header h4 {
  margin: 0;
  font-size: 16px;
  color: white;
}

.card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.description {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin: 8px 0;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.tags {
  display: flex;
  gap: 6px;
}

.tag {
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.8);
}

.stats {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.play-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #3b82f6, #9333ea);
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.play-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.play-btn:disabled {
  background: linear-gradient(135deg, #64748b, #475569);
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.play-btn.playing {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.play-btn.playing:disabled {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  opacity: 0.8;
}

.cinematic-actions {
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.create-cinematic-btn {
  width: 100%;
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: not-allowed;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.create-cinematic-btn small {
  font-size: 11px;
  opacity: 0.7;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .panel-container {
    width: 100vw;
    height: 60vh;
    max-width: none;
    right: 0;
    transform: none;
    border-radius: 12px 12px 0 0;
  }

  .panel-container.collapsed {
    height: 80px;
  }

  .menu-item {
    padding: 12px;
    /* Bigger touch target */
    font-size: 24px;
    /* Larger emoji */
    border-radius: 8px;
    flex: 1;
    /* Each item takes equal space */
    justify-content: center;
    /* Center the emoji */
  }

  .panel-content {
    padding: 12px;
  }

  .cinematic-card {
    padding: 10px;
  }

  .play-btn {
    width: 100%;
    margin-top: 8px;
  }

  .close-button {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 32px;
    /* Much larger font size */
    padding: 12px;
    /* Larger padding for bigger touch target */
    background: rgba(0, 0, 0, 0.2);
    /* Subtle background */
    border-radius: 50%;
    /* Make it circular */
    width: 48px;
    /* Fixed width */
    height: 48px;
    /* Fixed height */
    z-index: 10;
  }

  .close-button:hover {
    background: rgba(0, 0, 0, 0.3);
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .cinematic-header {
    gap: 8px;
  }

  .cinematic-filters {
    width: 100%;
    justify-content: space-between;
  }
}